<?php
class Wsky_session {
	static $pre = '';
	private $id = '';
	private $name = '';
	
	public function __construct(){
	 if(file_exists($path = ROOT.'./config/gloabel.configs.inc.php')) require_once $path;
	 $conf = & $_config['session_config'];
	 session_set_cookie_params($conf['lifttime'],$conf['path'],$conf['domain'],$conf['secure'],$conf['httponly']);
	 session_start();
	 $this->pre = $conf['pre'];
	 $this->id = session_id();
	 $this->name = session_name();
	}
	
	static function _set($key,$val){
		return $_SESSION[self::$pre.$key] = $val;
	}
	
	static function _get($key){
		return $_SESSION[self::$pre.$key];
	}
	
//	static function remove($key){
//		if(unset($_SESSION[$this->pre.$key])) return false;
//		else return true;
//	}
	
	static function destory(){
		setcookie($this->name, '', 0, '/');
		return session_destroy();
	}
}
?>